//
//  QuotesManager.m
//  CBT
//
//  Created by Mr.Zhang on 2018/12/6.
//  Copyright © 2018 Mr.Zhang. All rights reserved.
//

#import "QuotesManager.h"

@implementation QuotesManager

+(void)getQuotesListWithPage:(NSInteger)page Block:(manager_result_block)block
{
    
    [NetWork requestWithURL:Network_GetQuotations params:nil httpMethod:@"GET" finishedBlock:^(NSURLSessionDataTask *task, id  _Nullable result) {
        block(result,[result[@"code"]intValue] == 100 ? kHttpRequestResultNormal : kHttpRequestResultError,result[@"message"]);
    } failureBlock:^(NSURLSessionDataTask *task, NSError *error) {
        block(nil,kHttpRequestResultError,kLocalizedString(@"网络异常，请稍后重试",nil));
    }];

}


+(void)getOrderListWithPage:(NSInteger)page Block:(manager_result_block)block {
    NSMutableDictionary * param = [[NSMutableDictionary alloc]init];
    //[param setObject:[CBTLocalUserManager sharedInstance].userId forKey:@"userId"];
    [param setObject:@"20" forKey:@"row"];
    [param setObject:[NSString stringWithFormat:@"%ld",(long)page] forKey:@"page"];
    [NetWork requestWithURL:Network_GetCommodity params:param httpMethod:@"POST" finishedBlock:^(NSURLSessionDataTask *task, id  _Nullable result) {
        block(result,[result[@"code"]intValue] == 100 ? kHttpRequestResultNormal : kHttpRequestResultError,result[@"message"]);
    } failureBlock:^(NSURLSessionDataTask *task, NSError *error) {
        block(nil,kHttpRequestResultError,kLocalizedString(@"网络异常，请稍后重试",nil));
    }];
    
}

@end
